R convert dataframe to a nested json file